Insertion Point
An object of class Insertion Point is a location between characters where text can be inserted. The first insertion point in a container is the place between the beginning of the container and the first character. In the Scriptable Text Editor, insertion points are zero-length text objects. As a result, they have the same properties and elements as text objects.PROPERTIES
Font
- The name of the font of the insertion point.
Class: String
Modifiable? YesLength
- The number of characters in a text object. For insertion points, the value of the Length property is always 0.
Class: Integer
Modifiable? NoOffset
- The number of possible insertion points from the beginning of the document to the insertion point. The first insertion point of a document is the insertion point before the first character.
Class: Integer
Modifiable? NoSize
- The point size that is active at an insertion point.
Class: Integer
Modifiable? YesStyle
- The text styles that are active at an insertion point.
Class: Text Style Info. Objects of this class have two properties: On Styles and Off Styles. The On Styles property specifies the styles that are active. The Off Styles property specifies the styles that are not active. Both properties are lists of constants that specify text styles. See "Elements of Text Objects" on page 314 for information about how styles are used. The constants that can be used in Style property lists arebold
,italic
,outline
,underline
, andshadow
.
Modifiable? YesUniform Styles
The text styles that are uniformly "on" or "off" for all characters of a text object. For insertion points, the Uniform Styles property indicates which text styles are active at the insertion point. It always has the same value as the Style property.
Class: Text Style Info. Objects of this class have two properties: On Styles and Off Styles. See "Elements of Text Objects" on page 314 for information about how styles are used. The constants that can be used in Uniform Styles property lists arebold
,italic
,outline
,underline
, andshadow
.
Modifiable? NoELEMENT CLASSES
NoneCOMMANDS HANDLED
Copy, Count, Data Size, Exists, Get, SetDEFAULT VALUE CLASS RETURNED
ReferenceEXAMPLES
The following statement moves the first word of a document to the insertion point after the tenth word.
tell document "Intro" of app "Scriptable Text Editor" move word 1 to insertion point after word 10 end tellThe following statement does the same thing:
tell document "Intro" of app "Scriptable Text Editor" move word 1 to after word 10 end tellAppleScript allows you to leave out the wordsinsertion point
when specifying locations with the Relative reference form. For more information about the Relative reference form, see "Relative" on page 138.